package com.taobao.api.request;

import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.WlbWaybillallocationRequestwaybillnumResponse;

/**
 * TOP API: taobao.wlb.waybillallocation.requestwaybillnum request
 * 
 * @author auto create
 * @since 1.0, 2013-08-03 16:51:00
 */
public class WlbWaybillallocationRequestwaybillnumRequest implements TaobaoRequest<WlbWaybillallocationRequestwaybillnumResponse> {

  private Map<String, String> headerMap = new TaobaoHashMap();
  private TaobaoHashMap       udfParams;                      // add
                                                              // user-defined
                                                              // text parameters
  private Long                timestamp;

  /**
   * 申请号码数量
   */
  private Long                num;

  /**
   * 外部去重号
   */
  private String              outBizCode;

  /**
   * 面单类型
   */
  private String              poolType;

  /**
   * 服务编码
   */
  private String              serviceCode;

  /**
   * 用户ID
   */
  private Long                userId;

  public void setNum(Long num) {
    this.num = num;
  }

  public Long getNum() {
    return this.num;
  }

  public void setOutBizCode(String outBizCode) {
    this.outBizCode = outBizCode;
  }

  public String getOutBizCode() {
    return this.outBizCode;
  }

  public void setPoolType(String poolType) {
    this.poolType = poolType;
  }

  public String getPoolType() {
    return this.poolType;
  }

  public void setServiceCode(String serviceCode) {
    this.serviceCode = serviceCode;
  }

  public String getServiceCode() {
    return this.serviceCode;
  }

  public void setUserId(Long userId) {
    this.userId = userId;
  }

  public Long getUserId() {
    return this.userId;
  }

  public Long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

  public String getApiMethodName() {
    return "taobao.wlb.waybillallocation.requestwaybillnum";
  }

  public Map<String, String> getTextParams() {
    TaobaoHashMap txtParams = new TaobaoHashMap();
    txtParams.put("num", this.num);
    txtParams.put("out_biz_code", this.outBizCode);
    txtParams.put("pool_type", this.poolType);
    txtParams.put("service_code", this.serviceCode);
    txtParams.put("user_id", this.userId);
    if (this.udfParams != null) {
      txtParams.putAll(this.udfParams);
    }
    return txtParams;
  }

  public void putOtherTextParam(String key, String value) {
    if (this.udfParams == null) {
      this.udfParams = new TaobaoHashMap();
    }
    this.udfParams.put(key, value);
  }

  public Class<WlbWaybillallocationRequestwaybillnumResponse> getResponseClass() {
    return WlbWaybillallocationRequestwaybillnumResponse.class;
  }

  public void check() throws ApiRuleException {
    RequestCheckUtils.checkNotEmpty(num, "num");
    RequestCheckUtils.checkNotEmpty(outBizCode, "outBizCode");
    RequestCheckUtils.checkNotEmpty(poolType, "poolType");
    RequestCheckUtils.checkNotEmpty(serviceCode, "serviceCode");
    RequestCheckUtils.checkNotEmpty(userId, "userId");
  }

  public Map<String, String> getHeaderMap() {
    return headerMap;
  }
}
